package it.gma.torero.expression;

import it.gma.torero.operand.AbstractComparationOperand;
import it.gma.torero.operand.BooleanOperand;
import it.gma.torero.operator.AndOperator;
import it.gma.torero.operator.ImplicationOperator;
import it.gma.torero.operator.NotOperator;
import it.gma.torero.operator.OrOperator;
import it.gma.torero.operator.XorOperator;

public abstract class AbstractBooleanExpression extends AbstractComparationOperand implements BooleanExpression {

	public AbstractBooleanExpression() {
		super(null);
	}
	
	
	public AndOperator and(BooleanOperand other) {

		return new AndOperator(this, other); 
	}

	public OrOperator or(BooleanOperand or) {
		return new OrOperator(this, or);
	}

	public NotOperator not() {
		return new NotOperator(this);
	}

	public ImplicationOperator implies(BooleanOperand operand) {
		return new ImplicationOperator(this, operand);
	}

	public XorOperator xor(BooleanOperand operand) {
		return new XorOperator(this, operand);
	}

	public abstract boolean evaluate();
	
	
	@Override
	public Object getValue() {
		return evaluate();
	}

}
